let db = require("../db/index");
// 查询某个用户的费用
exports.employeeFee = (req, res) => {
    var sql =
        'select  payment.*,Owner ,Phone,BuildingName,FloorNumber,UnitName,RoomNumber from payment,room,building, unit,floor where building.BuildingID=unit.BuildingID AND unit.UnitID=floor.UnitID and floor.FloorID=room.FloorID and room.RoomID=payment.RoomID ';
    db.query(sql, [], (err, data) => {
        if (err) {
            console.log("出错了", err);
            return res.send("错误" + err.message);
        }
        res.send(data);
    });
};

//缴费管理
exports.allPrice = (req, res) => {
    var sql =
        'select * from payment ';
    db.query(sql, [], (err, data) => {
        if (err) {
            console.log("出错了", err);
            return res.send("错误" + err.message);
        }
        res.send(data);
    });
};